<?php
    require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../model/Service/MemberService.php';
    require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../model/Context/BaseContext.php';
    require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../model/ServiceResult/ServiceResult.php';
    $memberService = new MemberService();
   
	
		$context = new BaseContext();
		$result = new ServiceResult();
		$memberDomainArr = $memberService->findAllMember($context, $result);
	?>
	<script type="text/javascript">
		$(document).ready(function () {
			
			$('#tableCus tr').click(function () {
				var text = $(this).find("td").eq(1).html();
	        	var value = $(this).find("td").eq(0).html();   	
	        	$("#clientText").val($.trim(text));
	        	$("#clientValue").attr("value",$.trim(value));
	        	dialog.remove(); 
			});
		});
	</script>
	<table border="1" id="tableCus" width="100%" >
	<?php 
		foreach ($memberDomainArr as $memberDomain)
		{
	?>
			<tr>
				<td>
					<?php echo $memberDomain->getMemberID(); ?>
				</td>
				<td>
					<?php echo $memberDomain->getClientName() . " - " . $memberDomain->getClientCompany() . " - " . $memberDomain->getLocation() ; ?>
				</td>				
			</tr>
	<?php 
		}
	?>
	</table>
